import React, {
  useState,
  useEffect
} from 'react'
import { StudentList } from '../../components/GetServerData'
export default function Student(props) {
  const [studentList, setStudentList] = useState([])

  
  useEffect(() => {
    console.log(props.useName)
    const res = async () => {
      const data = await StudentList()
      setStudentList(data.data)
    }
    res()
  }, [])
  return (
    <div>
      {studentList.map((item, i) => {
        return (
          <div key={i}>{item.name}</div>
        )
      })}
    </div>
  )
}
